package com.wait;

public class BreadProductThread extends Thread{
	private BreadBox box;
	
	public BreadProductThread(BreadBox box) {
		this.box=box;
	}
	
	@Override
	public void run() {
		
		for(int i=0;i<10;i++){
			Bread bread=new Bread();
			bread.setId(i);
			bread.setBrand("嘉华");
			box.put(bread);
			System.out.println(Thread.currentThread().getName()+"生产出了第"+i+"面包。");
		}
	}
	
}
